#include "eventcenter.h"
#include <QLabel>
#include <QApplication>
#include <QHBoxLayout>
EventCenter &EventCenter::Instance()
{
    static EventCenter instance;
    return instance;
}

EventCenter::~EventCenter()
{
    delete message;
}

bool EventCenter::GetApplicationMode()
{
    return RELEASE_MODE;
}

void EventCenter::Warning(QString s)
{
    message->information(nullptr,"提示",s);
}

EventCenter::EventCenter()
{
    Init();
}

void EventCenter::Init()
{
    connect(this,&EventCenter::ApplicationMode,this,[=](bool release){
        RELEASE_MODE = release;
    });
    message = new QMessageBox();
    message->setWindowIcon(QIcon(":/res/icon/tip.png"));
}
